<?php

namespace CNAM\ActimanBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;


class ProcedurePlanifieeType extends AbstractType {
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('dateDebutProc','date')
            ->add('dateFinProc','date')
            ->add('periode','entity',array('class'=> 'CNAMActimanBundle:Periode','property' => 'typePeriode','empty_value' => 'Choisir une periode','empty_data'  => Null))
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'CNAM\ActimanBundle\Entity\ProcedurePlanifiee'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'cnam_actimanbundle_procedureplanifiee';
    }
}
